﻿<UserControl x:Class="AuthenticationServiceUI.Page"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:my="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" 
    HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" >
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="10"></RowDefinition>
            <RowDefinition Height="50"></RowDefinition>
            <RowDefinition Height="280" ></RowDefinition>
            <RowDefinition Height="190"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="50"></ColumnDefinition>
            <ColumnDefinition Width="930"></ColumnDefinition>
            <ColumnDefinition Width="10"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Border Grid.Row="1" Grid.Column="1" BorderBrush="CadetBlue" BorderThickness="2" CornerRadius="6" Margin="0,5,0,5">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition ></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="35"></RowDefinition>
                </Grid.RowDefinitions>
                <TextBlock Text="Single Sign On - Monitor" Grid.Column="0" 
                           HorizontalAlignment="Center" VerticalAlignment="Center" 
                           FontWeight="Bold" FontSize="15" 
                           FontFamily="Monotype Corsiva"
                           Margin="5,3,0,0"></TextBlock>
                
            </Grid>
        </Border>
        
        <Border Grid.Row="2" Grid.Column="1" BorderBrush="CadetBlue" BorderThickness="2" CornerRadius="6">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="15*"></RowDefinition>
                    <RowDefinition Height="60*"></RowDefinition>
                    <RowDefinition Height="15*"></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="310"></ColumnDefinition>
                    <ColumnDefinition Width="5"></ColumnDefinition>
                    <ColumnDefinition Width="610"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Column="0" Grid.Row="0" Orientation="Horizontal" Margin="5,0,0,0">
                    <TextBlock Text="Online users: " FontWeight="Bold" FontSize="14" VerticalAlignment="Bottom"></TextBlock>
                    <TextBlock x:Name="OnlineUsersCount" Text="0" FontSize="14" VerticalAlignment="Bottom"/>
                </StackPanel>

                <StackPanel Grid.Column="2" Grid.Row="0" Orientation="Horizontal" Margin="5,0,0,0">
                    <TextBlock Text="Security Tokens: " FontWeight="Bold" FontSize="14" VerticalAlignment="Bottom"></TextBlock>
                    <TextBlock x:Name="SecurityTokensCount" Text="0" FontSize="14" VerticalAlignment="Bottom"/>
                </StackPanel>

                <my:DataGrid x:Name="onlineUsersGrid" Grid.Column="0" Grid.Row="1" Width="302" IsReadOnly="True"
                             MinHeight="60" MaxHeight="700" AutoGenerateColumns="False">
                    <my:DataGrid.Columns>
                        <my:DataGridTextColumn Binding="{Binding LoginId}" Header="Login Id" Width="150"></my:DataGridTextColumn>
                        <my:DataGridTextColumn Binding="{Binding LoginTime}" Header="Login Time" Width="150"></my:DataGridTextColumn>
                    </my:DataGrid.Columns>
                </my:DataGrid>
                <my:DataGrid x:Name="securityTokensGrid" Grid.Column="2" Grid.Row="1" Width="602" IsReadOnly="True"
                             MinHeight="60" MaxHeight="700" AutoGenerateColumns="False">
                    <my:DataGrid.Columns>
                        <my:DataGridTextColumn Binding="{Binding User.LoginId}" Header="Login Id" Width="150"></my:DataGridTextColumn>
                        <my:DataGridTextColumn Binding="{Binding Id}" Header="Token" Width="300"></my:DataGridTextColumn>
                        <my:DataGridTextColumn Binding="{Binding CreateTime}" Header="Create Time" Width="150"></my:DataGridTextColumn>
                    </my:DataGrid.Columns>
                </my:DataGrid>
                
                <StackPanel Grid.Column="0" Grid.Row="2" Orientation="Horizontal" Margin="5,0,0,0">
                    <TextBlock Text="Last Updated: "></TextBlock>
                    <TextBlock x:Name="LastUpdatedOnlineUserValueLabel" Text="" />
                </StackPanel>

                <StackPanel Grid.Column="2" Grid.Row="2" Orientation="Horizontal" Margin="5,0,0,0">
                    <TextBlock Text="Last Updated: "></TextBlock>
                    <TextBlock x:Name="LastUpdatedSecurityTokenValueLabel" Text="12:23:30 AM" />
                    <TextBlock Text="Current Time: " Margin="285,0,0,0" Foreground="LightSeaGreen"></TextBlock>
                    <TextBlock x:Name="CurrentTimeValueLabel" Text="12:23:30 AM" TextAlignment="Right" Foreground="LightSeaGreen"/>
                </StackPanel>
            </Grid>
        </Border>
        <Border Grid.Row="3" Grid.Column="1" BorderBrush="CadetBlue" BorderThickness="2" CornerRadius="6" Margin="0,5,0,0">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="100"></ColumnDefinition>
                    <ColumnDefinition Width="150/"></ColumnDefinition>
                    <ColumnDefinition Width="300"></ColumnDefinition>
                    <ColumnDefinition Width="75"></ColumnDefinition>
                    <ColumnDefinition Width="150"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="35"></RowDefinition>
                    <RowDefinition Height="35"></RowDefinition>
                    <RowDefinition Height="35"></RowDefinition>
                    <RowDefinition Height="35"></RowDefinition>
                    <RowDefinition Height="35"></RowDefinition>
                </Grid.RowDefinitions>
                <TextBlock Text="Make a Service Call" Grid.Column="0" Grid.ColumnSpan="5" FontWeight="Bold" FontSize="15" Margin="5,3,0,0"></TextBlock>
                <TextBlock Grid.Column="0" Grid.Row="1" Text="Login" Margin="3,0,0,0" Height="30"></TextBlock>
                <TextBlock Grid.Column="0" Grid.Row="2" Text="Get Token" Margin="3,0,0,0" Height="30"></TextBlock>
                <TextBlock Grid.Column="0" Grid.Row="3" Text="Validate Token" Margin="3,0,0,0" Height="30"></TextBlock>
                <TextBlock Grid.Column="0" Grid.Row="4" Text="Log Out" Margin="3,0,0,0" Height="30"></TextBlock>
                
                <TextBox x:Name="LoginIdTextBox" Grid.Column="1" Grid.Row="1"  Height="30"/>
                <TextBox x:Name="PasswordTextBox" Grid.Column="2" Grid.Row="1"  Height="30"/>
                <TextBox x:Name="GetTokenLoginIdTextBox" Grid.Column="1" Grid.Row="2"  Height="30"/>
                <TextBox x:Name="GetTokenTextBox" Grid.Column="2" Grid.Row="2"  Height="30"/>
                <TextBox x:Name="ValidateTokenTextBox" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="2" Height="30"/>
                <TextBox x:Name="LogoutTextBox" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="2"  Height="30"/>

                <Button x:Name="LoginButton" Content="Go" Grid.Column="3" Grid.Row="1" Width="70" Height="30" Click="LoginButton_Click"></Button>
                <Button x:Name="GetTokenButton" Content="Go" Grid.Column="3" Grid.Row="2" Width="70" Height="30" Click="GetTokenButton_Click"></Button>
                <Button x:Name="ValidateTokenButton" Content="Go" Grid.Column="3" Grid.Row="3" Width="70" Height="30" Click="ValidateTokenButton_Click"></Button>
                <Button x:Name="LogOutButton" Content="Go" Grid.Column="3" Grid.Row="4" Width="70" Height="30" Click="LogOutButton_Click"></Button>
            </Grid>
        </Border>
    </Grid>
</UserControl>
